package com.seewintech.framework.common.success;

import lombok.Data;
import org.springframework.http.HttpStatus;

/**
 * @author by xiaoTian
 * @date 2022/6/14.
 */
@Data
public class AjaxResult {

    private Integer code;

    private String message;

    public AjaxResult(Integer num){
        if (num > 0){
            setCode(HttpStatus.OK.value());
            setMessage(HttpStatus.OK.getReasonPhrase());
        }else {
            setCode(HttpStatus.INTERNAL_SERVER_ERROR.value());
            setMessage(HttpStatus.INTERNAL_SERVER_ERROR.getReasonPhrase());
        }
    }

}
